CC=g++
CPPFLAGS= -std=c++11 -O2
LDFLAGS= -lstdc++ -lpthread -mwindows -lgdiplus -lmsimg32 -lcomctl32 -static
SOURCES_CPP = src/cimp/ctlSelectableBox.cpp	\
	 src/control.cpp src/core.cpp src/eventTranslate.cpp	\
	 src/judge_point.cpp src/positionChange.cpp 	\
	 src/userEvent.cpp src/draw/draw.cpp src/color/ctlColorDefine.cpp	\
	 src/interface/IDrag.cpp src/ctlFont.cpp		\
	src/draw/roundRect.cpp src/draw/caretdraw.cpp	\
	src/edit/caret.cpp	src/ctlText.cpp src/handle/editinsertlimit.cpp \
	src/cimp/ctlEdit.cpp src/draw/trianglebutton.cpp	\
	src/cimp/ctlScroll.cpp src/handle/mousestay.cpp	\
	 src/interface/IFont.cpp src/draw/editdraw.cpp	\
	src/draw/bkdraw.cpp src/ctlImage.cpp \
	src/cimp/ctlProgress.cpp src/color/ctlGradientStyle.cpp	\
	src/color/ctlProgressStyle.cpp src/interface/ISmoothTransform.cpp\
	src/cimp/ctlSingleEdit.cpp src/cimp/ctlPassword.cpp	\
	src/combine_rgn.cpp src/handle/listSort.cpp	\
	src/cimp/ctlList.cpp src/cimp/ctlButton.cpp\
	src/cimp/ctlImageButton.cpp src/draw/imagedraw.cpp\
	src/cimp/ctlSlider.cpp
	
OBJS_CPP:=$(patsubst %.cpp,%.o, $(SOURCES_CPP))
OBJS:= $(OBJS_CPP)

all: swui

%.d: %.cpp
	@rm -f $@;
	@$(CC) -MM $< > $@.1111; \
	sed 's,/($*/)/.o[ :]*,/1.o $@ : ,g' < $@.1111 > $@;  \
	rm -f $@.1111
	sinclude $(SOURCES_CPP:.cpp=.d)

swui:$(OBJS)
	ar crv swui.a $(OBJS) 

clean:
	rm -fv *.o *.d
	rm -fv src/*.o src/*.d
	rm -fv src/draw/*.o src/draw/*.d
	rm -fv src/color/*.o src/color/*.d
	rm -fv src/interface/*.o src/interface/*.d
	rm -fv src/cimp/*.o src/cimp/*.d
	rm -fv src/edit/*.o src/edit/*.d
	rm -fv src/handle/*.o src/handle/*.d
#	rm ../controlContain/controlContain/main.o